package com.tencent.iov.cowin.befsale.clue.dao.clue;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.QueryClueRequest;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ClueIntentionGrade;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ClueToMqResponse;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.clueIssueConfigResponse;
import com.tencent.iov.cowin.befsale.clue.controller.cus.vo.request.ClueIntentionGradeDataRequest;
import com.tencent.iov.cowin.befsale.clue.domain.clue.po.Clue;
import com.software.boot.dao.annotation.MyBatisRepository;
import com.software.boot.dao.common.BaseDao;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * @Describe: 线索信息表_Dao接口层
 * @author: whp
 * @created: 2021-12-21 16:16:05
 * @version: 1.0
 */
@MyBatisRepository
public interface ClueDao extends BaseDao<Clue> {

    /**
     * 通过ID获取详细信息
     *
     * @param: id
     * @return: Clue对象
     */
    Clue getDetailById(Long id);

    /**
     * 单条数据插入Clue
     *
     * @param request
     * @return 插入的条数
     */
    int insert(Clue request);

    /**
     * 批量插入Clue
     *
     * @param requests
     * @return 批量插入的条数
     */
    int insertBatch(List<Clue> requests);

    /**
     * 单条Clue更新
     *
     * @param request
     * @return 更新的条数
     */
    int update(Clue request);


    /**
     * 单条Clue更新
     *
     * @param request
     * @return 更新的条数
     */
    int updateByIds(Clue request);

    /**
     * 通过ID删除数据
     *
     * @param id
     * @return 删除的条数
     */
    int delete(Integer id);

    /**
     * 根据条件查询对象对象list列表
     *
     * @param request
     * @return 查询结果
     */
    List<Clue> getListByParam(Clue request);

    /**
     * 根据条件查询对象分页对象
     *
     * @param request
     * @return 查询结果
     */
    Page<Clue> getPageByParam(Clue request, RowBounds rowBounds);

    /**
     * 根据参数查询线索信息
     * @param request 参数
     * @return 线索信息
     */
    Clue getOneByParam(Clue request);

    List<ClueIntentionGrade> getClueIntentionGradeData(ClueIntentionGradeDataRequest clueIntentionGradeDataRequest);

    /**
     * 根据条件获取顾问新增线索数量
     * add by zly
     * 2022-01-15
     * @param clueDataRequest
     * @return
     */
    Long getEmpClueNumByTime(ClueIntentionGradeDataRequest clueDataRequest);

    /**
     * 根据条件获取顾问跟进下单线索
     * add by zly
     * 2022-01-16
     * @param clueDataRequest
     * @return
     */
    Long getEmpFollowOrderNum(ClueIntentionGradeDataRequest clueDataRequest);

    /**
     * 根据条件查询顾问对应线索数量
     * add by zly
     * 2022-01-16
     * @param clueDataRequest
     * @return
     */
    Long getEmpNumByClueStatus(ClueIntentionGradeDataRequest clueDataRequest);

    /**
     * 根据 线索分配规则查询线索数量
     * add by zly
     * @param queryClueRequest
     * @return
     */
    Integer getclueCountByParam(QueryClueRequest queryClueRequest);

    /**
     * 根据 线索分配规则分页查询线索信息
     *  add by zly
     *  2022-01-22
     * @param queryClueRequest
     * @return
     */
    List<ClueToMqResponse> queryCluePageRequest(QueryClueRequest queryClueRequest);

    List<clueIssueConfigResponse> getConfigList();

    int updateClueStatus(Clue clue);
}